/*
 * Copyright (c) 2018.
 * By:kaihangchen
 * E-mail:cmxds@hotmail.com
 */

package cn.cmxds.store.view.Impl.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.GridView;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import cn.cmxds.store.R;
import cn.cmxds.store.presenter.IGoodsResultPresenter;
import cn.cmxds.store.presenter.Impl.GoodsResultPresenter;
import cn.cmxds.store.util.ToastFactory;
import cn.cmxds.store.view.IGoodsResultView;

/**
 * 查询结果显示的页面
 * Created by 11655 on 2016/10/23.
 */

public class GoodsResultActivity extends BaseActivity implements IGoodsResultView {
    @BindView(R.id.act_goods_result_gv)
    GridView mActGoodsResultGv;
    private IGoodsResultPresenter presenter;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.goods_result);
        ButterKnife.bind(this);
        new GoodsResultPresenter(this);
        presenter.initData();
    }

    @Override
    public void showMsg(String msg) {
        ToastFactory.getToast(this,msg).show();
    }

    @Override
    public void showLoadingDialog(String title, String msg, boolean flag) {
        super.showProcessDialog(title, msg, flag);
    }

    @Override
    public void canelLoadingDialog() {
        super.dismissProcessDialog();
    }

    @Override
    public void jumpActivity() {
//        startActivity(new Intent(this,GoodsDetailsActivity.class));
    }

    @Override
    public void setPresenter(IGoodsResultPresenter presenter) {
        this.presenter = presenter;
    }

    @Override
    public String getDatas() {
        //获取intent对象
        Intent intent = getIntent();
        //获取传递过来的数据
        return intent.getStringExtra("datas");
    }
    @Override
    public GridView getmActGoodsResultGv() {
        return mActGoodsResultGv;
    }

    @OnClick({R.id.toolbar_left_button})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.toolbar_left_button:
                finish();
                break;

        }
    }


}
